<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>列拖动</title>
  <script src="./js/jexcel.js"></script>
  <script src="./js/jsuites.js"></script>
  <link rel="stylesheet" href="./css/jsuites.css" type="text/css" />
  <link rel="stylesheet" href="./css/jexcel.css" type="text/css" />
</head>

<body>
  <h1>列拖动</h1>
  <p>默认情况下，列拖动是禁用的。你可以使用初始化标志来启用该特性:columnDrag: true，如下所示:</p>

  <div id="spreadsheet"></div>
</body>
<script>
  var data = [
    ['BR', 'Cheese', 1],
    ['CA', 'Apples', 0],
    ['US', 'Carrots', 1],
    ['GB', 'Oranges', 0],
  ];

  table = jspreadsheet(document.getElementById('spreadsheet'), {
    data: data,
    columns: [
      {
        type: 'autocomplete',
        title: 'Country',
        width: '300',
        url: './static/countries.json'
      },
      {
        type: 'dropdown',
        title: 'Food',
        width: '150',
        source: ['Apples', 'Bananas', 'Carrots', 'Oranges', 'Cheese']
      },
      {
        type: 'checkbox',
        title: 'Stock',
        width: '100'
      },
    ],
    columnDrag: true,
  });
</script>

</html>